namespace GameFrame
{
    public unsafe delegate void ComponentSerializeDelegate(
        void* component,
        FrameSerializer serializer);
    
    public unsafe delegate void ComponentChangedDelegate(
        FrameBase frame,
        EntityRef entity,
        void* component);
    public struct ComponentCallbacks
    {
        public ComponentSerializeDelegate Serialize;
        public ComponentChangedDelegate OnAdded;
        public ComponentChangedDelegate OnRemoved;

        public ComponentCallbacks(ComponentSerializeDelegate serialize)
        {
            this.Serialize = serialize;
            this.OnAdded = (ComponentChangedDelegate) null;
            this.OnRemoved = (ComponentChangedDelegate) null;
        }

        public ComponentCallbacks(
            ComponentSerializeDelegate serialize,
            ComponentChangedDelegate onAdded,
            ComponentChangedDelegate onRemoved)
        {
            this.Serialize = serialize;
            this.OnAdded = onAdded;
            this.OnRemoved = onRemoved;
        }
    }
}